gtkpopover: Ensure the pointed to rectangle has a minimum w/h
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 27 Feb 2020 17:07:38 +0000 (18:07 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Fri, 20 Mar 2020 14:52:19 +0000 (15:52 +0100)
On wayland, protocol errors will be raised if the rectangle width/height
are 0. Avoid that situation so it's valid to all popovers.

gtk/gtkpopover.c

index ef7253d1235faf0fa27e4b68019733b9cb58792c..c6e2d70e0d9f15625eb5d2d2fc904c00c34358b2 100644 (file)
@@ -1650,6 +1650,8 @@ gtk_popover_set_pointing_to (GtkPopover         *popover,
     {
       priv->pointing_to = *rect;
       priv->has_pointing_to = TRUE;
+      priv->pointing_to.width = MAX (priv->pointing_to.width, 1);
+      priv->pointing_to.height = MAX (priv->pointing_to.height, 1);
     }
   else
     priv->has_pointing_to = FALSE;